<?php

/**
 * 微博抓取管理
 */

include_once($_SERVER["DOCUMENT_ROOT"] . "/core/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/core/admin.inc.php");

include_once($_SERVER["DOCUMENT_ROOT"] . "/include/user/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/include/mblog/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/include/tuijian/inc.php");

include_once($_SERVER["DOCUMENT_ROOT"] . "/include/qq/inc.php");
$g_cgival = array();
$g_pro = array();
$g_show = array();


function check_cgi_pro()
{
	global $g_cgival, $g_pro, $g_show;
		//页码
	cgi::get($g_cgival["p"], "p", 1);
	$g_cgival["p"] = intval($g_cgival["p"]);

	cgi::get($g_cgival["type"], "type", 0);
	$g_cgival["type"] = intval($g_cgival["type"]);
	
	cgi::get($g_cgival["status"], "status", 1);
	$g_cgival["status"] = string::un_html($g_cgival["status"]);
	
	cgi::get($g_cgival["id"], "id", "");
	$g_cgival["id"] = string::un_html($g_cgival["id"]);
}

function get_data()
{
	global $g_cgival, $g_pro, $g_show,$config;
	
	$start_year = "2013";
	$get_weeks = ceil((time()-strtotime("$start_year-01-01"))/(86400*7));
	$id= $g_cgival["id"];
	$g_cgival["pcount"] = 20;
	$g_show['status'] = $g_cgival["status"];
	$site_id = $g_cgival["site_id"];
	$db_tuijian_mblog = new db_tuijian_mblog();
	$db_tuijian_daren = new db_tuijian_daren();
	$item = $db_tuijian_daren->admin_get_item_by_id($id);
	
	$g_show["item"] = $item;
}

$g_show["error"] = 0;
$g_show["errmsg"] = '';
try
{
	admin_check_login();
// 	admin_check_user_priv("foodv2/album_list.php");
	
	check_cgi_pro();
	get_data();
}
catch(Exception $e)
{
	$g_show["error"] = 1;
	$g_show["errmsg"] = $e->getMessage();
}

show_pro();
exit;


function show_pro()
{
	global $g_cgival, $g_pro, $g_show;
	if(isset($_GET['debug']))
		print_r($g_show);
	$smarty = p_get_smarty ();
	$smarty->assign ( 'g_show', $g_show );
	$smarty->display ( "mblog/tuijian_user_edit.html" );
}

